package toss.model;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.users.User;

public class SystemUser {

	@PrimaryKey
	private User user;
	
	@Persistent
	private List<Event> events = new ArrayList<Event>();
	
	public SystemUser(){
	}
	public SystemUser(User user) {
		this.user = user;
	}
	public User getUser() {
		return user;
	}
	public List<Event> getSubmitedEvents() {
		return events;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public void setSubmitedEvents(List<Event> events) {
		this.events = events;
	}
	public void AddEvent(Event event) {
		if(!events.contains(event)){
			events.add(event);
		}
	}

	public void RemoveEvent(Event event) {
		events.remove(event);
	}

}
